﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.IO;
using System.Runtime.InteropServices;
using System.Security.Permissions;
//using records;

namespace WindowsFormsApplication1
{
    public partial class Form2 : Form
    {
        public struct st
        {
           public string name;
            public int score;
        };

        
        st[] player = new st[10];

        public Form2()
        {
            InitializeComponent();
            records rec = new records();
            string tmp_str = rec.Read_record();
            string[] str = tmp_str.Split(' ');

            for (int i = 0; i < 10; i++)
            {
                player[i].name = str[2 * i];
                player[i].score = Convert.ToInt32(str[2 * i + 1]);

            }
            
        }

        private void pictureBox1_Paint(object sender, PaintEventArgs e)
        {

            for (int i = 0; i < 10; i++)
            {
                e.Graphics.DrawString(player[i].name + player[i].score.ToString(), new Font("Consolas", 11), new SolidBrush(Color.FromArgb(200, Color.Black)), 50, 85 + 20 * i);
            }
            
            //e.Graphics.DrawString("1. Абрамович        1000\n2. Вассерман        900\n3. Путин            500\n4. Обама            400\n5. Обама            400\n6. Обама            400\n7. Обама            400\n8. Обама            400\n9. Обама            400\n10. Обама           400\n", new Font("Consolas", 11), new SolidBrush(Color.FromArgb(200, Color.Black)), 50, 85);
            
        }

        private void Form2_Load(object sender, EventArgs e)
        {

        }

       
        private void button1_Click(object sender, EventArgs e)
        {
            Close();
        }
    }
}
